<?php
include 'header.php';
?>

<div class="pageBox">
	<div class="channelList">
    	<?php $k=0; 
    	foreach($subCatalog as $sub):
			if($sub['type']=='page'): continue; endif;
			if($sub['pid']==$catalog['id']):?>
    	<dl>
        	<dt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $sub['name'];?></dt>
            <?php if ($sub['type']=='channel'):?>
            <?php foreach ($subCatalog as $item):?>
            <?php if ($item['pid']==$sub['id']):?>
            <dd>▪&nbsp;&nbsp;<a href="/catalog?id=<?php echo $item['id'];?>" target="_blank"><?php echo $item['name'];?></a></dd>
            <?php endif;?>
            <?php endforeach;?>
            <?php else:?>
            <?php foreach ($channelArchives as $item):?>
            <?php if ($item['catalog_id']==$sub['id']):?>
            <dd>▪&nbsp;&nbsp;<a href="/archive?id=<?php echo $item['id'];?>" target="_blank"><?php echo $item['title'];?></a></dd>
            <?php endif;?>
            <?php endforeach;?>
            <?php endif;?>
        </dl>
        <?php if(++$k%3==0): continue; endif; ?>
        <div style="width:10px; height:100px; float:left"></div>
        <?php 
			endif;
		endforeach;?>
    </div>
</div>

<?php 
include 'footer.php';
?>